const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const routes = require('./routes');
const expressLayouts = require('express-ejs-layouts');

const app = express();
const PORT = 3000;

app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'));
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(expressLayouts);
app.set('layout', 'layout');

app.use('/', routes);

app.listen(PORT, () => {
  console.log(`MockMini running at http://localhost:${PORT}`);
}); 